#ifndef TESTZCURVE_H
#define TESTZCURVE_H

#include "../arbol-ub/zcurve.h"
#include "../arbol-ub/zcurve.cpp"
#include "../persistencia/file.h"

void testZCurve(){

    ZCurve<3, 16> z;
    ZPoint<3*16> zp;
    Point<3> p;

    p = {7, 17 ,20};
    zp = z.map(p);
    std::cout << zp.to_ulong() << " Should be 12646" << std::endl;

    p = z.inv(zp);
    std::cout << p[0] << "," <<  p[1] << "," << p[2] << " Should be 7,17,20" << std::endl;

    zp = 14880;
    p = z.inv(zp);
    std::cout << p[0] << "," <<  p[1] << "," << p[2] << " Should be 10,16,24" << std::endl;

    zp = z.map(p);
    std::cout << zp.to_ulong() << " Should be 14880" << std::endl;


    std::cout << z.inRange(6370, 15332, 7879) << " Should be false" << std::endl;

    std::cout << z.inRange(6370, 15332, 7992) << " Should be true" <<std::endl;

    std::cout << z.nextZAddress(6370, 15332, 6903).to_ulong() << " Should be 7042" <<std::endl;

    std::cout << z.nextZAddress(6370, 15332, 14967).to_ulong() << " Should be 15008" <<std::endl;

    std::cout << std::endl;
}


#endif // TESTZCURVE_H
